suffix notation
Học thuậtThân thiện
Definition
Noun: 1. A method of writing mathematical expressions without parentheses: In suffix notation, each operator (like +, -, ×) is written after its operands (the numbers or variables it acts upon). This eliminates the need for parentheses to indicate the order of operations. It is also commonly called Reverse Polish Notation (RPN).
Usage
Suffix notation is primarily used in computer science, logic, and some calculator systems because it provides an unambiguous way to represent calculations that a computer can evaluate easily using a stack data structure.
Examples
- Simple Arithmetic:
- The infix expression
(3 + 4) × 5is written in suffix notation as3 4 + 5 ×. - The infix expression
5 + (6 × 7)becomes5 6 7 × +in suffix notation.
- Computer Evaluation:
- The compiler used suffix notation internally to optimize the calculation of the expression.
- To evaluate
2 3 4 + ×, a stack-based processor would first add 3 and 4, then multiply the result by 2.
Advanced Usage
- Unambiguous Parsing: A key advantage of suffix notation is that any valid expression has a single, clear order of evaluation without needing rules for operator precedence or parentheses.
- Stack-Based Computation: Expressions in suffix notation are evaluated using a simple algorithm involving a stack, making it efficient for computer hardware and software.
Variants and Related Words
- Reverse Polish Notation (RPN): This is the most common synonym for suffix notation. It is named after the Polish logician Jan Łukasiewicz.
- Postfix Notation: Another exact synonym for suffix notation.
- Polish Notation (Prefix Notation): The opposite system, where each operator is written its operands (e.g., ).
- Infix Notation: The standard notation where operators are placed operands (e.g., ), which requires parentheses or precedence rules.
Synonyms
- Reverse Polish Notation (RPN)
- Postfix Notation
Related Concepts (Not Phrasal Verbs or Idioms)
- Stack: A fundamental data structure (Last-In, First-Out) used to evaluate expressions written in suffix notation.
- Operator: A symbol (like +, −, ×, ÷) that represents a mathematical operation.
- Operand: A number or variable upon which an operator acts.
Noun
- a parenthesis-free notation for forming mathematical expressions in which each operator follows its operands